package com.it.tydic.estate.common.aop;

/**
 * 返回异常
 */
public class CodeMsg implements Cloneable {
    private int retCode;
    private String message;

    // 通用异常
    public static CodeMsg SUCCESS = new CodeMsg(200, "success");
    public static CodeMsg INTER_ERROR = new CodeMsg(500, "服务异常");

    public static CodeMsg EMPTY_PARAM_ERROR = new CodeMsg(10000, "参数为空");
    public static CodeMsg INSERT_ERROR = new CodeMsg(10001, "添加失败");
    public static CodeMsg UPDATE_ERROR = new CodeMsg(10002, "修改失败");
    public static CodeMsg DELETE_ERROR = new CodeMsg(10003, "删除失败");
    public static CodeMsg DATA_REPEATE = new CodeMsg(10004, "该数据已存在");
    public static CodeMsg NO_NUTHEN = new CodeMsg(10005, "无权限操作");
    public static CodeMsg LOGIN_FAILURE = new CodeMsg(10006, "用户名或密码错误");
    public static CodeMsg DATA_CHANGE_FALSE = new CodeMsg(10007, "变更失败");
    public static CodeMsg LOGIN_FORBIDDEN = new CodeMsg(10008, "用户被禁用，登录失败");
    public static CodeMsg LOGIN_EXPIARE = new CodeMsg(10009, "用户已过期，登录失败");
    public static CodeMsg ROLE_USE = new CodeMsg(100010, "角色已被占用");
    public static CodeMsg RESOURCE_USE = new CodeMsg(100011, "资源已被占用");
    public static CodeMsg PASSWOR_RESET = new CodeMsg(100012, "密码修改成功");
    public static CodeMsg OLD_PASSWORD_ERR = new CodeMsg(100013, "旧密码错误");
    public static CodeMsg DATA_NOT_EXIST = new CodeMsg(100014, "该数据不存在");
    public static CodeMsg INVALID_TOKEN  = new CodeMsg(100015, "登录已过期，请重新登录");
    public CodeMsg(int retCode, String message) {
        this.retCode = retCode;
        this.message = message;
    }

    public int getRetCode() {
        return retCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return (CodeMsg) super.clone();
    }
}
